home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 47.7z / BS1 part 47 / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 4 of 7)[HD].7z / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 4 of 7)[HD].adf / apa.lzh.parta / imh_ubuffers < prev    next >
Text File  |  1994-04-22  |  9KB  |  190 lines

  1. \ApAssist
  2. \: "imdoc:imh_ubuffers" Understanding Buffers - portion of the IM documentation
  3.  
  4. \font topaz.font 8
  5. \tc 1
  6. \wr
  7. \lj
  8.  
  9. \index "imdoc:imh_index/index"
  10. \toc "imdoc:imh_toc/toc"
  11. \help "imdoc:aa_help/help"
  12.  
  13. \node "ubuffers"
  14. \title "Understanding Image Buffers"
  15. \prev "IMDOC:imh_intro/aboutdocs"
  16. \next "IMDOC:imh_bigthree/bigthree"
  17.  
  18. \nw \{ \font topaz.font 11 \tc 15 \ts b
  19. General
  20. \}
  21.  
  22. \wr
  23. Imagemaster R/t is designed to handle any number of images loaded into memory
  24. at one time. This is the source of considerable flexibility, and so you need
  25. to understand exactly how Imagemaster R/t manages these images.
  26.  
  27. The first thing to understand is that an image buffer is \ts i always \ts n
  28. 24-bits per image pixel. It doesn't matter if the image was only two colors,
  29. or if it had millions; when Imagemaster R/t loads an image, it creates only
  30. one type of image buffer and that is the 24-bit type we're talking about
  31. right now. Greyscale, color - none of this makes any difference; Imagemaster
  32. R/t still creates 24-bits per pixel.
  33.  
  34. Next, image buffers are \ts i always \ts n rectangular. Imagemaster R/t is
  35. able to maintain a mask for an image, allowing the usuable area to be
  36. non-rectangular, however the memory has been obtained from the Amiga
  37. operating system to hold information for the entire rectangle.
  38.  
  39. The final basic idea is that \ts i all \ts n images within Imagemaster R/t
  40. are maintained in the exact same type of buffer. That means if you load a
  41. brush to paint with, an image buffer is allocated for it and the the brush is
  42. loaded into the buffer. If you want to use a classic "alpha channel"
  43. technique, the alpha channel will come from - you guessed it - a standard
  44. image buffer.
  45.  
  46. The advantages of this system are manyfold. First, because all images are
  47. loaded into exactly the same kind of buffer, you gain the ability to do
  48. \ts u anything\ts n \= to any image. You can run image processes on a "brush",
  49. and you can paint in an "alpha channel". You can swap the roles of the images
  50. that are loaded in a flash - turn the alpha channel into a paintbrush and the
  51. paintbrush into the main image to work on where you can paint on \ts i
  52. it\ts n .
  53.  
  54. To make all this work smoothly, we need a way to identify which buffer is
  55. which easily, and so Imagemaster R/t allows you to name image buffers. Each
  56. loaded or newly created buffer gets a name; if Imagemaster has a hint of what
  57. you would like it to be called, it will use it; otherwise, it names the
  58. buffer \ts b Clip_n \ts n or \ts b Brush_n \ts n where "n" is a number from 1
  59. to some very high value. If it decides to name something a "clip" or a
  60. "brush", it will normally also give you the opportunity to rename it at the
  61. time it creates the buffer. This automatic numbering and naming system makes
  62. it unlikely that you'll have two image buffers with the same name (although
  63. this is certainly possible; it's just confusing).
  64.  
  65. Imagemaster R/t \ts i also \ts n allows you to select buffers by clicking on
  66. \ts bi postage stamp \ts n images which show you exactly what is in a
  67. particular buffer. This is a very "friendly" way to choose what you're going
  68. to work on at any given moment.
  69.  
  70. Image buffers keep more than just the picture information and the optional
  71. mask of the image's shape. They also hold on to some important statistics
  72. about the image, such as...
  73.  
  74. \nw \{ \lm 40
  75. \{ \ra \image "Clips/Bullet2.pic" l 10 The image's \ts i Aspect Ratio \ts n \}
  76. \{ \ra \image "Clips/Bullet2.pic" l 10 The image's \ts i DPI \ts n or Dots Per Inch\}
  77. \{ \ra \image "Clips/Bullet2.pic" l 10 The image's last used zoom level (for editing)\}
  78. \{ \ra \image "Clips/Bullet2.pic" l 10 The image's name\}
  79. \{ \ra \image "Clips/Bullet2.pic" l 10 The image's unique internal identifier\}
  80. \{ \ra \image "Clips/Bullet2.pic" l 10 The image's \ts i parent \ts n if it was a "clip" or a "brush"\}
  81. \{ \ra \image "Clips/Bullet2.pic" l 10 Locking information; if the image is in use, it is "locked"\}
  82. \}
  83.  
  84. \wr
  85. Most of this information is normally hidden from you; for instance, the only
  86. time you need to know about the image's aspect ratio is when you create a
  87. completely new image or if an image is loaded which has an incorrect aspect
  88. ratio (this happens often on the Amiga, however). So you'll only see the
  89. image aspect ratio if you change it. Imagemaster R/t uses the image aspect
  90. information at all times in order to show you the image in it's correct
  91. shape. Without aspect information, images might look stretched, or squashed.
  92.  
  93. \nw \{ \font topaz.font 11 \tc 15 \ts b
  94. Image buffer \ts i Roles
  95. \}
  96.  
  97. \wr
  98. While Imagemaster R/t only has one type of image buffer, image buffers may
  99. have several different \ts i roles\ts n . A role in this context is what part
  100. in your image manipulation efforts a particular image buffer is "playing".
  101. These are all of the possible roles:
  102.  
  103. \nw \{ \lm 40
  104. \{ \ra \image "Clips/Bullet2.pic" l 10 Primary Buffer\}
  105. \{ \ra \image "Clips/Bullet2.pic" l 10 Secondary Buffer\}
  106. \{ \ra \image "Clips/Bullet2.pic" l 10 Blend Buffer\}
  107. \{ \ra \image "Clips/Bullet2.pic" l 10 Brush Buffer\}
  108. \{ \ra \image "Clips/Bullet2.pic" l 10 No role assigned\}
  109. \}
  110.  
  111. \wr
  112. When an image is being directly worked on - that is, you are processing it,
  113. painting on it or composing other images \ts i into \ts n it, that image is
  114. in the role of the \ts b Primary Buffer\ts n . The reasoning is simple:
  115. Operations primarily affect this image buffer, and not others.
  116.  
  117. When an image is being used in the paint system as a brush, it is in the role
  118. of the \ts b Brush Buffer\ts n .
  119.  
  120. When an image is used as a source image being composed \ts i into \ts n
  121. another buffer, it is in the role of the \ts b Secondary Buffer\ts n .
  122.  
  123. When an image is used as an \ts i alpha channel mask \ts n for either an
  124. image composition, brush transparency, or Unsharp Masking, it is in the role
  125. of the \ts b Blend Buffer\ts n .
  126.  
  127. \nw \{ \font topaz.font 11 \tc 15 \ts b
  128. The Undo Buffer
  129. \}
  130.  
  131. \wr
  132. There is one other type of buffer, and that is the buffer that is assigned to
  133. the role of the \ts i Undo \ts n buffer. The Undo buffer is where Imagemaster
  134. R/t copies the image just \ts i before \ts n it makes any changes you have
  135. specified. The reason this is done is so that if you decide you don't
  136. \ts u like\ts n \= the change you made, you can request an Undo operation
  137. which is simply when Imagemaster R/t copies the contents of the Undo buffer
  138. back into your main image. Actually, it's a little bit more interesting than
  139. that; if there is already something in the Undo buffer, Imagemaster R/t will
  140. swap those contents with your buffer, which allows you to "Undo an Undo". The
  141. role of the Undo buffer is so specialized that Imagemaster R/t is able to
  142. manage it with no assistance from you; for this reason, although you will see
  143. the Undo buffer listed with all the other buffers in the system, you are not
  144. allowed to select it for processing.
  145.  
  146. \nw \{ \font topaz.font 11 \tc 15 \ts b
  147. Image buffers consume large amounts of memory
  148. \}
  149.  
  150. \wr
  151. \lab "more" The final thing you should know about image buffers is how much
  152. memory an image is likely to consume. You don't need to know exactly, but you
  153. should have a general idea because since Imagemaster R/t can load \ts i any
  154. \ts n number of images, it can use up \ts b all \ts n of your free memory
  155. without much warning. Here are the calculations for memory consumption:
  156.  
  157. \nw \{ \lm 40
  158. \ts b In all cases: \ts n
  159. (X size) x (Y size) x 3 - Any non-primary unmasked buffer
  160. (X size) x (Y size) x 4 - Any non-primary masked buffer
  161.  
  162. \ts b If the UnDo buffer function is \ts i off\ts n : \ts n
  163. (X size) x (Y size) x 4 - Any primary unmasked buffer
  164. (X size) x (Y size) x 5 - Any primary masked buffer
  165.  
  166. \ts b If the UnDo buffer function is \ts i on\ts n : \ts n
  167. (X size) x (Y size) x 7 - Any primary unmasked buffer
  168. (X size) x (Y size) x 8 - Any primary masked buffer
  169. \}
  170.  
  171. \wr
  172. As you should be able to see, large images will use large amounts of your
  173. computer's memory. Let's do a quick example. If you load an image which is
  174. sized at 768x480 and has no mask, which makes it the primary buffer,
  175. and the Undo function is on, then we use this formula:
  176.  
  177. (X size) x (Y size) x 7 - Any primary unmasked buffer
  178.  
  179. So the calculation is: 768 x 480 x 7 = 2,580,480 bytes. Over two and a half
  180. megabytes of memory. Larger images consume more memory; smaller ones consume
  181. less. A mathematical law called the "Square Law" is at work here. If another
  182. image is one half as high and one half as wide, it will consume one
  183. \ts i quarter \ts n the amount of memory. As an example, 368 x 240 x 7 = 618,240
  184. bytes of memory.
  185.  
  186. One thing you can be certain of, is that the more memory you have in your
  187. Amiga, the more you'll be able to do at once.
  188.  
  189. \endnode
  190.